// JavaScript Document
// JavaScript Document

function validsignup()
{
	if ( document.signup.fname.value == "" )
	{
		alert("Please Enter Your First Name !");
		document.signup.fname.focus();
		return false;
	}
	
	if ( document.signup.lname.value == "" )
	{
		alert("Please Enter Your Last Name !");
		document.signup.lname.focus();
		return false;
	}
	
	if ( document.signup.gender.value == "-Select-" )
	{
		alert("Please Select Your Gender !");
		return false;
	}
	
	if ( document.signup.day.value == "-Day-" )
	{
		alert("Please Select Your Day of Date of Birth !");
		return false;
	}
	
	if ( document.signup.month.value == "-Month-" )
	{
		alert("Please Select Your Month of Date of Birth !");
		return false;
	}
	
	if ( document.signup.year.value == "-Year-" )
	{
		alert("Please Select Your Year of Date of Birth !");
		return false;
	}
	
	if ( document.signup.location.value == "-Country-" )
	{
		alert("Please Select Your Country !");
		return false;
	}
	
	if ( document.signup.city.value == "-City-" )
	{
		alert("Please Give Your City !");
		document.signup.city.focus();
		return false;
	}
	
	if ( document.signup.nic.value == "" )
	{
		alert("Please Enter Your Complete NIC !");
		document.signup.nic.focus();
		return false;
	}
	
	if ( document.signup.mobile.value == "" )
	{
		alert("Please Enter Your Mobile Number !");
		document.signup.mobile.focus();
		return false;
	}
	
	if ( document.signup.office.value == "" )
	{
		alert("Please Enter Your Office Number !");
		document.signup.office.focus();
		return false;
	}
	
	if ( document.signup.fax.value == "" )
	{
		alert("Please Enter Your Fax Number !");
		document.signup.fax.focus();
		return false;
	}
	
	if ( document.signup.qualification.value == "" )
	{
		alert("Please Enter Your Qualification !");
		document.signup.qualification.focus();
		return false;
	}
	
	if ( document.signup.address.value == "" )
	{
		alert("Please Enter Your Complete Residence Address !");
		document.signup.address.focus();
		return false;
	}
	
	if ( document.signup.email.value == "" )
	{
		alert("Please Enter Your Email !");
		document.signup.email.focus();
		return false;
	}
	else
	{
	
		var x = document.forms["signup"]["email"].value;
		var atpos = x.indexOf("@");
		var fdotpos = x.indexOf(".");
		var dotpos = x.lastIndexOf(".");
		if (atpos < 1 || dotpos<atpos+2 || dotpos+2 >= x.length || fdotpos < 1)
  		{
			alert("Not a valid e-mail address");
			document.signup.email.focus();
  			return false;
  		}	
	}
	if ( document.signup.file.value == "" )
	{
		alert("Please Upoload Your Resume !");
		document.signup.file.focus();
		return false;
	}
}

// JavaScript Document
function signupclear()
{
	document.signup.fname.value = "";
	document.signup.lname.value = "";
	document.signup.gender.value = "-Select";
	document.signup.day.value = "-Day-";
	document.signup.month.value = "-Month-";
	document.signup.year.value = "-Year-";
	document.signup.location.value = "_country-";
	document.signup.city.value = "-City-";
	document.signup.nic.value = "";
	document.signup.mobile.value = "";
	document.signup.office.value = "";
	document.signup.fax.value = "";
	document.signup.qualification.value = "";
	document.signup.address.value = "";
	document.signup.email.value = "";
	document.signup.file.value = "";
	
	return false;
}